
const Calculator = require('./Calculator')

class Budget {
  constructor () {
    this.calculator = new Calculator()
  }

  createBudgets (hotels, stay) {
    return this.getPriceHotels(stay, hotels)
  }

  getPriceHotels (stay, hotels) {
    return hotels.map(hotel => {
      return {
        name: hotel.getName(),
        rating: hotel.getRating(),
        budget: this.calculator.calculateBudget(stay, hotel.getRate())
      }
    })
  }
}

module.exports = Budget
